import { Graph } from '@antv/x6';
import { NODE_TYPE_END } from '../constant';

export function registerEndNode() {
  Graph.registerNode(NODE_TYPE_END, {
    inherit: 'circle',
    attrs: {
      body: {
        r: 15,
        strokeWidth: 2,
        stroke: '#ff4d4f',
        fill: '#fff2f0',
      },
      label: {
        text: '结束',
        fill: '#ff4d4f',
        fontSize: 12,
        textAnchor: 'middle',
        textVerticalAnchor: 'middle',
      },
    },
    ports: {
      groups: {
        in: {
          position: 'left',
          attrs: {
            circle: {
              r: 4,
              magnet: true,
              stroke: '#ff4d4f',
              strokeWidth: 1,
              fill: '#fff',
            },
          },
        },
      },
      items: [
        {
          id: 'in',
          group: 'in',
        },
      ],
    },
  });
} 